|
nfc7spi 2.2.2
|
API for configuring and manipulating NFC 7 SPI Click driver. More...
Topics | |
| NFC 7 SPI Registers List | |
| List of registers of NFC 7 SPI Click driver. | |
| NFC 7 SPI Registers Settings | |
| Settings for registers of NFC 7 SPI Click driver. | |
| NFC 7 SPI MikroBUS Map | |
| MikroBUS pin mapping of NFC 7 SPI Click driver. | |
Functions | |
| void | nfc7spi_cfg_setup (nfc7spi_cfg_t *cfg) |
| NFC 7 SPI configuration object setup function. | |
| err_t | nfc7spi_init (nfc7spi_t *ctx, nfc7spi_cfg_t *cfg) |
| NFC 7 SPI initialization function. | |
| err_t | nfc7spi_default_cfg (nfc7spi_t *ctx) |
| NFC 7 SPI default configuration function. | |
| void | nfc7spi_enable_device (nfc7spi_t *ctx) |
| NFC 7 SPI enable device function. | |
| void | nfc7spi_disable_device (nfc7spi_t *ctx) |
| NFC 7 SPI disable device function. | |
| void | nfc7spi_reset_device (nfc7spi_t *ctx) |
| NFC 7 SPI reset device function. | |
| uint8_t | nfc7spi_get_irq_pin (nfc7spi_t *ctx) |
| NFC 7 SPI get IRQ pin function. | |
| err_t | nfc7spi_tx (nfc7spi_t *ctx, uint8_t *data_in, uint16_t len) |
| NFC 7 SPI TX function. | |
| err_t | nfc7spi_rx (nfc7spi_t *ctx, uint8_t *data_out, uint16_t *len, uint16_t timeout) |
| NFC 7 SPI RX function. | |
| err_t | nfc7spi_trx (nfc7spi_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint16_t *out_len) |
| NFC 7 SPI TRX function. | |
| err_t | nfc7spi_pkt_ctrl_tx (nfc7spi_t *ctx, nfc7spi_pkt_ctrl_t *pkt) |
| NFC 7 SPI packet control TX function. | |
| err_t | nfc7spi_pkt_ctrl_rx (nfc7spi_t *ctx, nfc7spi_pkt_ctrl_t *pkt, uint16_t timeout) |
| NFC 7 SPI packet control RX function. | |
| err_t | nfc7spi_pkt_ctrl_trx (nfc7spi_t *ctx, nfc7spi_pkt_ctrl_t *pkt) |
| NFC 7 SPI packet control TRX function. | |
| err_t | nfc7spi_pkt_data_tx (nfc7spi_t *ctx, nfc7spi_pkt_data_t *pkt) |
| NFC 7 SPI packet data TX function. | |
| err_t | nfc7spi_pkt_data_rx (nfc7spi_t *ctx, nfc7spi_pkt_data_t *pkt, uint16_t timeout) |
| NFC 7 SPI packet data RX function. | |
| err_t | nfc7spi_pkt_data_trx (nfc7spi_t *ctx, nfc7spi_pkt_data_t *pkt) |
| NFC 7 SPI packet data TRX function. | |
| err_t | nfc7spi_core_reset (nfc7spi_t *ctx) |
| NFC 7 SPI core reset function. | |
| err_t | nfc7spi_core_init (nfc7spi_t *ctx) |
| NFC 7 SPI core init function. | |
| err_t | nfc7spi_core_standby (nfc7spi_t *ctx, uint8_t mode) |
| NFC 7 SPI core standby function. | |
| err_t | nfc7spi_core_total_duration (nfc7spi_t *ctx) |
| NFC 7 SPI core total duration function. | |
| err_t | nfc7spi_core_tag_detector (nfc7spi_t *ctx) |
| NFC 7 SPI core tag detector function. | |
| err_t | nfc7spi_core_clock_sel (nfc7spi_t *ctx) |
| NFC 7 SPI core clock sel function. | |
| err_t | nfc7spi_core_pmu (nfc7spi_t *ctx) |
| NFC 7 SPI core PMU function. | |
| err_t | nfc7spi_core_rf_config (nfc7spi_t *ctx) |
| NFC 7 SPI core RF config function. | |
| err_t | nfc7spi_config_settings (nfc7spi_t *ctx) |
| NFC 7 SPI config settings function. | |
| err_t | nfc7spi_map_rf_interface (nfc7spi_t *ctx) |
| NFC 7 SPI map RF interface function. | |
| err_t | nfc7spi_start_discovery (nfc7spi_t *ctx) |
| NFC 7 SPI start discovery function. | |
| err_t | nfc7spi_stop_discovery (nfc7spi_t *ctx) |
| NFC 7 SPI stop discovery function. | |
| err_t | nfc7spi_wait_discovery (nfc7spi_t *ctx, nfc7spi_rf_intf_t *rf_intf) |
| NFC 7 SPI wait discovery function. | |
| void | nfc7spi_presence_check (nfc7spi_t *ctx, nfc7spi_rf_intf_t *rf_intf) |
| NFC 7 SPI presence check function. | |
| err_t | nfc7spi_reader_act_next (nfc7spi_t *ctx, nfc7spi_rf_intf_t *rf_intf) |
| NFC 7 SPI reader activate next function. | |
| err_t | nfc7spi_reader_re_act (nfc7spi_t *ctx, nfc7spi_rf_intf_t *rf_intf) |
| NFC 7 SPI reader reactivate next function. | |
| err_t | nfc7spi_reader_tag_cmd (nfc7spi_t *ctx, nfc7spi_pkt_data_t *pkt) |
| NFC 7 SPI reader tag cmd function. | |
API for configuring and manipulating NFC 7 SPI Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void nfc7spi_cfg_setup | ( | nfc7spi_cfg_t * | cfg | ) |
NFC 7 SPI configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See nfc7spi_cfg_t object definition for detailed explanation. |
| err_t nfc7spi_config_settings | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI config settings function.
This function sets the default core config settings.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_clock_sel | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core clock sel function.
This function sets the core clock selection to NFC7SPI_NCI_CORE_CLOCK_SEL_XTAL.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_init | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core init function.
This function resets and initializes the device core.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_pmu | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core PMU function.
This function sets the core power management unit to NFC7SPI_NCI_CORE_PMU_IRQ_EN_TVDD_3V3.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_reset | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core reset function.
This function resets the device core and reads the FW version.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_rf_config | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core RF config function.
This function sets the core RF config to NFC7SPI_NCI_CORE_RF_CONF.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_standby | ( | nfc7spi_t * | ctx, |
| uint8_t | mode ) |
NFC 7 SPI core standby function.
This function sets the core standby mode.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | mode | :
|
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_tag_detector | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core tag detector function.
This function sets the core tag detector to NFC7SPI_NCI_CORE_TAG_DETECTOR_DIS.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_core_total_duration | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI core total duration function.
This function sets the core total duration of the single discovery period to NFC7SPI_NCI_CORE_TOTAL_DURATION_510MS.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_default_cfg | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI default configuration function.
This function executes a default configuration of NFC 7 SPI Click board.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void nfc7spi_disable_device | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI disable device function.
This function disables the device by setting the VEN pin to LOW logic state.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| void nfc7spi_enable_device | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI enable device function.
This function enables the device by setting the VEN pin to HIGH logic state.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| uint8_t nfc7spi_get_irq_pin | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI get IRQ pin function.
This function returns the IRQ pin logic state.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| err_t nfc7spi_init | ( | nfc7spi_t * | ctx, |
| nfc7spi_cfg_t * | cfg ) |
NFC 7 SPI initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See nfc7spi_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_map_rf_interface | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI map RF interface function.
This function enables all RF protocols and interface in poll mode.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_ctrl_rx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_ctrl_t * | pkt, | ||
| uint16_t | timeout ) |
NFC 7 SPI packet control RX function.
This function waits a desired period for a NCI control packet response to arrive and reads it.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [out] | pkt | : NCI control packet data structure read. See nfc7spi_pkt_ctrl_t object definition for detailed explanation. |
| [in] | timeout | : Waiting data timeout in milliseconds. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_ctrl_trx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_ctrl_t * | pkt ) |
NFC 7 SPI packet control TRX function.
This function sends a NCI control packet using nfc7spi_pkt_ctrl_tx function and reads the response using nfc7spi_pkt_ctrl_rx with a 1 second timeout.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in,out] | pkt | : NCI control packet data structure to write (response packet is populated here). See nfc7spi_pkt_ctrl_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_ctrl_tx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_ctrl_t * | pkt ) |
NFC 7 SPI packet control TX function.
This function sends a desired NCI control packet data.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | pkt | : NCI control packet data structure to be sent. See nfc7spi_pkt_ctrl_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_data_rx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_data_t * | pkt, | ||
| uint16_t | timeout ) |
NFC 7 SPI packet data RX function.
This function waits a desired period for a NCI data packet response to arrive and reads it.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [out] | pkt | : NCI data packet data structure read. See nfc7spi_pkt_data_t object definition for detailed explanation. |
| [in] | timeout | : Waiting data timeout in milliseconds. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_data_trx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_data_t * | pkt ) |
NFC 7 SPI packet data TRX function.
This function sends a NCI data packet using nfc7spi_pkt_data_tx function and reads the response using nfc7spi_pkt_data_rx with a 1 second timeout.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in,out] | pkt | : NCI data packet data structure to write (response packet is populated here). See nfc7spi_pkt_data_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_pkt_data_tx | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_data_t * | pkt ) |
NFC 7 SPI packet data TX function.
This function sends a desired NCI data packet data.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | pkt | : NCI data packet data structure to be sent. See nfc7spi_pkt_data_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void nfc7spi_presence_check | ( | nfc7spi_t * | ctx, |
| nfc7spi_rf_intf_t * | rf_intf ) |
NFC 7 SPI presence check function.
This function waits until the discovered target device is removed.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | rf_intf | : Filled with discovered NFC remote device properties. |
| err_t nfc7spi_reader_act_next | ( | nfc7spi_t * | ctx, |
| nfc7spi_rf_intf_t * | rf_intf ) |
NFC 7 SPI reader activate next function.
This function performs activation of the next tag (in case of multiple tag detection or multi-protocol tag).
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in,out] | rf_intf | : Filled with discovered NFC remote device properties. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_reader_re_act | ( | nfc7spi_t * | ctx, |
| nfc7spi_rf_intf_t * | rf_intf ) |
NFC 7 SPI reader reactivate next function.
This function performs reactivation of the current tag.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | rf_intf | : Filled with discovered NFC remote device properties. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_reader_tag_cmd | ( | nfc7spi_t * | ctx, |
| nfc7spi_pkt_data_t * | pkt ) |
NFC 7 SPI reader tag cmd function.
This function performs RAW data packet transceive operation (send then receive) with the remote tag.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in,out] | pkt | : NCI data packet data structure to write (response packet is populated here). See nfc7spi_pkt_data_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void nfc7spi_reset_device | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI reset device function.
This function resets the device by toggling the VEN pin.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| err_t nfc7spi_rx | ( | nfc7spi_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t * | len, | ||
| uint16_t | timeout ) |
NFC 7 SPI RX function.
This function waits a desired period for a data received flag and reads the data by using SPI serial interface.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [out] | len | : Number of bytes read. |
| [in] | timeout | : Waiting data timeout in milliseconds. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_start_discovery | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI start discovery function.
This function starts RF discovery for NFC-A, NFC-B, NFC-F, and NFC-V technologies.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_stop_discovery | ( | nfc7spi_t * | ctx | ) |
NFC 7 SPI stop discovery function.
This function stops the RF discovery process.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_trx | ( | nfc7spi_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | in_len, | ||
| uint8_t * | data_out, | ||
| uint16_t * | out_len ) |
NFC 7 SPI TRX function.
This function sends data using nfc7spi_tx function and reads the response using nfc7spi_rx with a 1 second timeout.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | data_in | : Data to be written. |
| [in] | in_len | : Number of bytes to be written. |
| [out] | data_out | : Output read data. |
| [out] | out_len | : Number of bytes read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_tx | ( | nfc7spi_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
NFC 7 SPI TX function.
This function writes a desired number of data bytes by using SPI serial interface.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nfc7spi_wait_discovery | ( | nfc7spi_t * | ctx, |
| nfc7spi_rf_intf_t * | rf_intf ) |
NFC 7 SPI wait discovery function.
This function waits until remote NFC device is discovered.
| [in] | ctx | : Click context object. See nfc7spi_t object definition for detailed explanation. |
| [out] | rf_intf | : Filled with discovered NFC remote device properties. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.